#include "calculateCenter3.h"

Result test3() {
	IplImage* img = cvLoadImage("C:\\Documents and Settings\\snirbo\\Desktop\\calculate_center\\pic1.bmp");	
	int* new_data = ConvertFromRgbToHsv(img);
	uchar *data = (uchar *)img->imageData;
	int channels  = img->nChannels;
	int step = img->widthStep;
	car test_car;
	test_car.licensePlate = 1;
	test_car.red = PIC1_RED;
	test_car.green = PIC1_GREEN;
	test_car.blue = PIC1_BLUE;
	test_car.h = PIC1_H;
	test_car.s = PIC1_S;
	test_car.v = PIC1_V;
	test_car.p = cvPoint(PIC1_START_X, PIC1_START_Y);
	CvPoint x = calculateCenter(img, new_data, test_car);
	if (x.x == PIC1_CENTER_X) {
		return (printTestResult(3, SUCCESS));
	} else {
		return (printTestResult(3, FAIL));
	}
}

#ifdef __TEST3__
int main(int argc, char **argv) {
	if (!test1() || !test2() || !test3()) {
		cout << "TOTAL TEST FAILED!\n";
		getchar();
		exit(1);
	}
	cout << "TOTAL TEST SUCCEEDED\n";
	getchar();
	return 0;
}
#endif